package com.bing.beans;

import org.aspectj.lang.ProceedingJoinPoint;
import org.springframework.stereotype.Component;

/**
 * Created by kaibb on 14-7-27.
 */
@Component
public class Audience {
    public void takeSeats() {
        System.out.println("Audience takeSeats....");
    }

    public void takeCutPhone() {
        System.out.println("Audience TakeCutPhone....");
    }

    public void applaud() {
        System.out.println("Audience applaud....");
    }

    public void error() {
        System.out.println("performError....");
    }


    public void watchPerform(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("Before point exece....");
        try {
            long start = System.currentTimeMillis();
            joinPoint.proceed();
            long end = System.currentTimeMillis();
            System.out.println("After point exece...." + (end - start));

        } catch (Throwable e) {
            System.out.println("hello exception: " + e.getMessage());
            throw e;
        }
    }

    public void readParamter(String str) {
        System.out.println("pointCut readParameter : " + str);
    }
}
